﻿<!DOCTYPE HTML>
<html>
{include file="public:header_css"}
<body id="allBody">
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 学生管理 <span class="c-gray en">&gt;</span> 学生列表
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
			<a class="btn btn-primary radius" href="{:url('add')}">
				<i class="Hui-iconfont">&#xe600;</i> 新增学生
			</a>
			<a href="{:url('qrcode')}" class="btn btn-success radius">
				<i class="Hui-iconfont"></i> 批量建码
			</a>
			<a class="btn btn-success radius" href="{:url('excelExport')}">
				导出学生信息
			</a>
		</span>
		<span class="r">共有：<strong>{$total}</strong> 条</span>
	</div>

	<form class="form-inline" role="form" method="get">
		<div id="" class="" style="float: right;margin-top: 20px;margin-bottom: 20px;">
			<label>姓名查找:
				<input type="search" class="input-text " value="{$name ? $stu_name : '';}" style="width: 200px;" name="keywords" id="keywords"  >
				<button class="btn btn-primary radius" type="submit" id="submit"  style="margin-top: -4px;">&nbsp;&nbsp;搜索&nbsp;&nbsp;</button>
				<button class="btn btn-warning radius" type="submit" id="reset"  style="margin-top: -4px;">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
			</label>
		</div>
	</form>

	<form class="form-inline" role="form" method="get">
		<div id="" class="" style="float: left;margin-top: 20px;margin-bottom: 20px;">
			<label>门店查找:
				<select style="width:40%;" class="input-text" id="keywords1" name="keywords1">
					<option value="0"  style="width:100%;">请点击选择</option>
					{foreach name="store_list" item="val" key="key"}
					<option value="{$val['store_id']}"  style="width:100%;" {if $keywords1==$val.store_id} selected {/if}>{$val['store_name']}</option>
					{/foreach}
				</select>
				<button class="btn btn-warning radius" type="submit" id="reset1"  style="float:right;margin-left:3px;">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
				<button class="btn btn-primary radius" type="submit" id="submit1"  style="float:right;">&nbsp;&nbsp;搜索&nbsp;&nbsp;</button>
			</label>
		</div>
	</form>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
			<tr class="text-c">
				<th width="110">学号</th>
				<th width="60">姓名</th>
				<th width="40">性别</th>
				<th width="70">学生电话</th>
				<th width="70">家长电话</th>
				<th width="100">具体门店</th>
				<th width="100">所在班级</th>
				<th width="60">是否毕业</th>
				<th width="140">操作</th>
			</tr>
			</thead>
			<tbody id="stuList">
			{foreach name="stu_list" item="val" key="key"}
			<tr class="text-c">
				<td>{$val['stu_no']}</td>
				<td>{$val['name']}</td>
				<td>
					{if $val['sex'] == 1}男
					{else /}女
					{/if}
				</td>
				<td>{$val['stu_tel']}</td>
				<td>{$val['par_tel']}</td>
				<td>{$val['store_name']}</td>
				<td>
					{if $val['is_arrange']==0 and $val['store_id']!=0}
					<a class="label label-secondary radius" id="tianjia" href="{:url('student_arrange/add',array('stu_id'=>$val['stu_id']))}">添加课程</a>
					{elseif $val['is_arrange']==0 and $val['store_id']==0}
					<a class="label label-secondary radius" onclick="toast()">添加课程</a>
					{else /}
					<a class="label label-secondary radius" href="{:url('student_arrange/index',array('stu_id'=>$val['stu_id']))}">查看课程</a>
					{/if}
				</td>
				<td>
					{if $val['is_finish'] == 0}学习中
					{else /}已毕业
					{/if}
				</td>
				<td class="f-14 product-brand-manage" id="use">
					<a class="label label-secondary radius" href="{:url('edit',array('stu_id'=>$val['stu_id']))}">编辑</a>
					<a href="javascript:;" onclick="bind('二维码','{:url(\'qr\')}','{$val.stu_id}','300','300')" class="label label-secondary radius" >二维码</a>
				</td>
			</tr>
			{/foreach}
			{if count($stu_list)<=0 }
			<tr class="text-c">
				<td colspan="10">
					暂无数据
				</td>
			</tr>
			{/if}
			</tbody>
		</table>
	</div>
	{$page}
</div>

{include file="public:footer_js"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/laypage/1.2/laypage.js"></script>

<script type="text/javascript">

	function toast() {
        layer.msg('请先编辑选择具体门店，再操作~',{icon:7,time:2000});
    }
    //绑定二维码
    function bind(title,url,id,w,h) {
        //该id为学生id
        $.ajax({
            type: "POST",
            url: "{:url('bind')}",
            data: {id: id},
            async: true,
            success: function (res) {
                if (res.code) {
                    layer_show(title, url, w, h);
                }
            }
        });
    }

    //姓名重置
    $('#reset').click(function () {
		$('#keywords').val('');
    })

    //门店重置
    $('#reset1').click(function () {
        $('#keywords1').val('');
    })


</script>
</body>
</html>